package com.abu.crms.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author abu
 */
public class CodeUtil {
    /**
     * 验证码生成
     * @param num
     * @return
     */
    public static String generator(int num) {
        StringBuilder builder = new StringBuilder(num);
        for (int i = 0; i < num; i++) {
            int randomNum = ThreadLocalRandom.current().nextInt(9) + 1;
            builder.append(randomNum);
        }
        return builder.toString();
    }
}
